home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / Doc / libgdbm.tex < prev    next >
LaTeX Document  |  1994-08-08  |  1.4 KB  |  [TEXT/R*ch]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: libgdbm.tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text, with CR line terminators default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[CR] default (weak)


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[R*ch]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 42 75 69 6c 74 2d 69 |\section|{Built-i|
|00000010| 6e 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |n Module| \sectco|
|00000020| 64 65 7b 67 64 62 6d 7d | 7d 0d 5c 62 69 6d 6f 64 |de{gdbm}|}.\bimod|
|00000030| 69 6e 64 65 78 7b 67 64 | 62 6d 7d 0d 0d 47 64 62 |index{gd|bm}..Gdb|
|00000040| 6d 20 70 72 6f 76 69 64 | 65 73 20 70 79 74 68 6f |m provid|es pytho|
|00000050| 6e 20 70 72 6f 67 72 61 | 6d 73 20 77 69 74 68 20 |n progra|ms with |
|00000060| 61 6e 20 69 6e 74 65 72 | 66 61 63 65 20 74 6f 20 |an inter|face to |
|00000070| 74 68 65 20 47 4e 55 20 | 5c 63 6f 64 65 7b 67 64 |the GNU |\code{gd|
|00000080| 62 6d 7d 0d 64 61 74 61 | 62 61 73 65 20 6c 69 62 |bm}.data|base lib|
|00000090| 72 61 72 79 2e 20 20 47 | 64 62 6d 20 6f 62 6a 65 |rary. G|dbm obje|
|000000a0| 63 74 73 20 61 72 65 20 | 6f 66 20 74 68 65 20 6d |cts are |of the m|
|000000b0| 61 70 70 69 6e 67 20 74 | 79 70 65 2c 20 73 6f 20 |apping t|ype, so |
|000000c0| 74 68 65 79 20 63 61 6e | 20 62 65 0d 68 61 6e 64 |they can| be.hand|
|000000d0| 6c 65 64 20 6a 75 73 74 | 20 6c 69 6b 65 20 6f 62 |led just| like ob|
|000000e0| 6a 65 63 74 73 20 6f 66 | 20 74 68 65 20 62 75 69 |jects of| the bui|
|000000f0| 6c 74 2d 69 6e 20 5c 64 | 66 6e 7b 64 69 63 74 69 |lt-in \d|fn{dicti|
|00000100| 6f 6e 61 72 79 7d 20 74 | 79 70 65 2c 0d 65 78 63 |onary} t|ype,.exc|
|00000110| 65 70 74 20 74 68 61 74 | 20 6b 65 79 73 20 61 6e |ept that| keys an|
|00000120| 64 20 76 61 6c 75 65 73 | 20 61 72 65 20 61 6c 77 |d values| are alw|
|00000130| 61 79 73 20 73 74 72 69 | 6e 67 73 2c 20 61 6e 64 |ays stri|ngs, and|
|00000140| 20 70 72 69 6e 74 69 6e | 67 20 61 20 67 64 62 6d | printin|g a gdbm|
|00000150| 0d 6f 62 6a 65 63 74 20 | 64 6f 65 73 6e 27 74 20 |.object |doesn't |
|00000160| 70 72 69 6e 74 20 74 68 | 65 20 6b 65 79 73 20 61 |print th|e keys a|
|00000170| 6e 64 20 76 61 6c 75 65 | 73 2e 0d 0d 54 68 65 20 |nd value|s...The |
|00000180| 6d 6f 64 75 6c 65 20 69 | 73 20 62 61 73 65 64 20 |module i|s based |
|00000190| 6f 6e 20 74 68 65 20 44 | 62 6d 20 6d 6f 64 75 6c |on the D|bm modul|
|000001a0| 65 2c 20 6d 6f 64 69 66 | 69 65 64 20 74 6f 20 75 |e, modif|ied to u|
|000001b0| 73 65 20 47 44 42 4d 20 | 69 6e 73 74 65 61 64 2e |se GDBM |instead.|
|000001c0| 0d 0d 54 68 65 20 6d 6f | 64 75 6c 65 20 64 65 66 |..The mo|dule def|
|000001d0| 69 6e 65 73 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |ines the| followi|
|000001e0| 6e 67 20 63 6f 6e 73 74 | 61 6e 74 20 61 6e 64 20 |ng const|ant and |
|000001f0| 66 75 6e 63 74 69 6f 6e | 73 3a 0d 0d 5c 72 65 6e |function|s:..\ren|
|00000200| 65 77 63 6f 6d 6d 61 6e | 64 7b 5c 69 6e 64 65 78 |ewcomman|d{\index|
|00000210| 73 75 62 69 74 65 6d 7d | 7b 28 69 6e 20 6d 6f 64 |subitem}|{(in mod|
|00000220| 75 6c 65 20 67 64 62 6d | 29 7d 0d 5c 62 65 67 69 |ule gdbm|)}.\begi|
|00000230| 6e 7b 65 78 63 64 65 73 | 63 7d 7b 65 72 72 6f 72 |n{excdes|c}{error|
|00000240| 7d 0d 52 61 69 73 65 64 | 20 6f 6e 20 67 64 62 6d |}.Raised| on gdbm|
|00000250| 2d 73 70 65 63 69 66 69 | 63 20 65 72 72 6f 72 73 |-specifi|c errors|
|00000260| 2c 20 73 75 63 68 20 61 | 73 20 49 2f 4f 20 65 72 |, such a|s I/O er|
|00000270| 72 6f 72 73 2e 20 5c 63 | 6f 64 65 7b 4b 65 79 45 |rors. \c|ode{KeyE|
|00000280| 72 72 6f 72 7d 20 69 73 | 0d 72 61 69 73 65 64 20 |rror} is|.raised |
|00000290| 66 6f 72 20 67 65 6e 65 | 72 61 6c 20 6d 61 70 70 |for gene|ral mapp|
|000002a0| 69 6e 67 20 65 72 72 6f | 72 73 20 6c 69 6b 65 20 |ing erro|rs like |
|000002b0| 73 70 65 63 69 66 79 69 | 6e 67 20 61 6e 20 69 6e |specifyi|ng an in|
|000002c0| 63 6f 72 72 65 63 74 20 | 6b 65 79 2e 0d 5c 65 6e |correct |key..\en|
|000002d0| 64 7b 65 78 63 64 65 73 | 63 7d 0d 0d 5c 62 65 67 |d{excdes|c}..\beg|
|000002e0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 6f 70 65 |in{funcd|esc}{ope|
|000002f0| 6e 7d 7b 66 69 6c 65 6e | 61 6d 65 5c 2c 20 72 77 |n}{filen|ame\, rw|
|00000300| 6d 6f 64 65 5c 2c 20 66 | 69 6c 65 6d 6f 64 65 7d |mode\, f|ilemode}|
|00000310| 0d 4f 70 65 6e 20 61 20 | 67 64 62 6d 20 64 61 74 |.Open a |gdbm dat|
|00000320| 61 62 61 73 65 20 61 6e | 64 20 72 65 74 75 72 6e |abase an|d return|
|00000330| 20 61 20 6d 61 70 70 69 | 6e 67 20 6f 62 6a 65 63 | a mappi|ng objec|
|00000340| 74 2e 20 5c 76 61 72 7b | 66 69 6c 65 6e 61 6d 65 |t. \var{|filename|
|00000350| 7d 20 69 73 0d 74 68 65 | 20 6e 61 6d 65 20 6f 66 |} is.the| name of|
|00000360| 20 74 68 65 20 64 61 74 | 61 62 61 73 65 20 66 69 | the dat|abase fi|
|00000370| 6c 65 2c 20 5c 76 61 72 | 7b 72 77 6d 6f 64 65 7d |le, \var|{rwmode}|
|00000380| 20 69 73 20 5c 63 6f 64 | 65 7b 27 72 27 7d 2c 20 | is \cod|e{'r'}, |
|00000390| 5c 63 6f 64 65 7b 27 77 | 27 7d 2c 0d 5c 63 6f 64 |\code{'w|'},.\cod|
|000003a0| 65 7b 27 63 27 7d 2c 20 | 6f 72 20 5c 63 6f 64 65 |e{'c'}, |or \code|
|000003b0| 7b 27 6e 27 7d 20 66 6f | 72 20 72 65 61 64 65 72 |{'n'} fo|r reader|
|000003c0| 2c 20 77 72 69 74 65 72 | 20 28 74 68 69 73 20 61 |, writer| (this a|
|000003d0| 6c 73 6f 20 67 69 76 65 | 73 20 72 65 61 64 0d 61 |lso give|s read.a|
|000003e0| 63 63 65 73 73 29 2c 20 | 63 72 65 61 74 65 20 28 |ccess), |create (|
|000003f0| 77 72 69 74 65 72 2c 20 | 62 75 74 20 63 72 65 61 |writer, |but crea|
|00000400| 74 65 20 74 68 65 20 64 | 61 74 61 62 61 73 65 20 |te the d|atabase |
|00000410| 69 66 20 69 74 20 64 6f | 65 73 6e 74 20 61 6c 72 |if it do|esnt alr|
|00000420| 65 61 64 79 0d 65 78 69 | 73 74 29 20 61 6e 64 20 |eady.exi|st) and |
|00000430| 6e 65 77 64 62 20 28 77 | 68 69 63 68 20 77 69 6c |newdb (w|hich wil|
|00000440| 6c 20 61 6c 77 61 79 73 | 20 63 72 65 61 74 65 20 |l always| create |
|00000450| 61 20 6e 65 77 20 64 61 | 74 61 62 61 73 65 29 2e |a new da|tabase).|
|00000460| 20 4f 6e 6c 79 20 6f 6e | 65 0d 77 72 69 74 65 72 | Only on|e.writer|
|00000470| 20 6d 61 79 20 6f 70 65 | 6e 20 61 20 67 64 62 6d | may ope|n a gdbm|
|00000480| 20 66 69 6c 65 20 61 6e | 64 20 6d 61 6e 79 20 72 | file an|d many r|
|00000490| 65 61 64 65 72 73 20 6d | 61 79 20 6f 70 65 6e 20 |eaders m|ay open |
|000004a0| 74 68 65 20 66 69 6c 65 | 2e 20 52 65 61 64 65 72 |the file|. Reader|
|000004b0| 73 0d 61 6e 64 20 77 72 | 69 74 65 72 73 20 63 61 |s.and wr|iters ca|
|000004c0| 6e 20 6e 6f 74 20 6f 70 | 65 6e 20 74 68 65 20 67 |n not op|en the g|
|000004d0| 64 62 6d 20 66 69 6c 65 | 20 61 74 20 74 68 65 20 |dbm file| at the |
|000004e0| 73 61 6d 65 20 74 69 6d | 65 2e 20 4e 6f 74 65 20 |same tim|e. Note |
|000004f0| 74 68 61 74 20 74 68 65 | 0d 5c 63 6f 64 65 7b 47 |that the|.\code{G|
|00000500| 44 42 4d 5f 46 41 53 54 | 7d 20 6d 6f 64 65 20 6f |DBM_FAST|} mode o|
|00000510| 66 20 6f 70 65 6e 69 6e | 67 20 74 68 65 20 64 61 |f openin|g the da|
|00000520| 74 61 62 61 73 65 20 69 | 73 20 6e 6f 74 20 73 75 |tabase i|s not su|
|00000530| 70 70 6f 72 74 65 64 2e | 20 5c 76 61 72 7b 66 69 |pported.| \var{fi|
|00000540| 6c 65 6d 6f 64 65 7d 20 | 0d 69 73 20 74 68 65 20 |lemode} |.is the |
|00000550| 75 6e 69 78 20 6d 6f 64 | 65 20 6f 66 20 74 68 65 |unix mod|e of the|
|00000560| 20 66 69 6c 65 2c 20 75 | 73 65 64 20 6f 6e 6c 79 | file, u|sed only|
|00000570| 20 77 68 65 6e 20 61 20 | 64 61 74 61 62 61 73 65 | when a |database|
|00000580| 20 69 73 20 63 72 65 61 | 74 65 64 2e 0d 5c 65 6e | is crea|ted..\en|
|00000590| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d |d{funcde|sc}. |
+--------+-------------------------+-------------------------+--------+--------+